<?php
/**
 *	[Anmp(Anmp.{modulename})] (C)2012-2099 Powered by abans@qq.com.
 *	Version: v1.0
 *	Date: 2012-10-11 14:40
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
if(!defined('Adz_class')){include('Adz.class.php');}
include('push.fun.php');
$push_op = push_op();

if($_POST){
	$save = $_POST['save'];
	foreach ($save as $k => $v) {
		$sdata[$k] = json_encode($v);
	}
	if(!$sdata) $sdata = array('mail'=>'{"f_rp":"0"}');
	Adz::mysql_save('plugin_push_set',$sdata,array('uid' => $_G['uid']));
	showmessage(lang('plugin/push','set_success'), $_G['siteurl'].'home.php?mod=spacecp&ac=plugin&id=push:set');
}
$data = push_set_data($_G['uid']);
$user = $_G['member'];
foreach ($push_op as $k => $v) {
	if($data['mail'][$v[0]]==1) $mailchk[$v[0]] = 'checked="checked"';
}
?>